package vno.fux.character
{
	import vno.fux.BasePoint;
	import vno.fux.events.MapEvent;

	public class Player implements ICharacrer
	{
		private var _playerModel:PlayerModel;
		private var _playerController:PlayerController;
		private var _playerView:PlayerView;
		public function Player(opts:Object)
		{
			_playerModel = new PlayerModel(opts);
			_playerController = new PlayerController(_playerModel);
			_playerView = new PlayerView(_playerModel, _playerController);
		}
	
		public function get view():BaseCharacterView
		{
			return _playerView;
		}
		public function changeDirection(direction:String):void
		{
			_playerView.direction = direction;
		}
		
		public function moveStateHandle(moveState:String):void
		{
			switch(moveState)
			{
				case MapEvent.START_MOVE:
					_playerView.move();
					break;
				case MapEvent.END_MOVE:
					_playerView.stop();
					break;
			}
		}
	}
}